<?php
/**
 * @package scuttle
 * @file /admin/forms/TagsAdminEditForm.class.php
 **/

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_ROOT_PATH.'/core/XCube_ActionForm.class.php';

class Scuttle_TagsAdminEditForm extends XCube_ActionForm
{
	function Scuttle_TagsEditForm()
	{
		parent::XCube_ActionForm();
	}

	function getTokenName()
	{
		return 'module.scuttle.TagsAdminEditForm.TOKEN';

	}
	function prepare()
	{
		$this->mFormProperties['tag']     =& new XCube_StringProperty('tag');
		$this->mFormProperties['new_tag'] =& new XCube_StringProperty('new_tag');

		$this->mFieldProperties['tag'] =& new XCube_FieldProperty($this);
		$this->mFieldProperties['tag']->setDependsByArray(array('required'));
		$this->mFieldProperties['tag']->addMessage('required', _AD_SC_ERROR_REQUIRED, _AD_SC_TAG);

		$this->mFieldProperties['new_tag'] =& new XCube_FieldProperty($this);
		$this->mFieldProperties['new_tag']->setDependsByArray(array('required'));
		$this->mFieldProperties['new_tag']->addMessage('required', _AD_SC_ERROR_REQUIRED, _AD_SC_TAG_NEW);

	}

	function load(&$obj)
	{
		$this->set('tag'     , $obj->get('tag'));
		$this->set('new_tag' , $obj->get('new_tag'));
	}

	function update(&$obj)
	{
		$obj->set('tag'     , $this->get('tag'));
		$obj->set('new_tag' , $this->get('new_tag'));
	}
}
?>